<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of AdverController
 *
 * @author Admin
 */
class AdverController extends Zend_Controller_Action
{
    public function PreDispatch() {
        $this->_helper->layout()->disableLayout();
        //$this->_helper->viewRenderer->setNoRender(true);
    }
    
    public function jsonAction() {             
        $id = 'asdfgdfg34t3564564yh46yh5656h56h';
        //$adver = '<!--BANNER -->';
        //$adver.= '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>';
        //$adver.= '<script type="text/javascript" src="/js/our_js/send_data.js"></script>';
        //$adver.= '<script>';
        //$adver.= 'var id = "asdfgdfg34t3564564yh46yh5656h56h";';
        //$adver.= 'getAdver(id);';
        //$adver.= '</script>';
        //$adver.= '<!-- END BANNER -->';
        
        $width = '300px';
        $height = '200px';
        
        $json = '"'.$id.'", "'.$width.'", "'.$height.'"';        
       // $this->_response->appendBody($_GET['callback'].'('.json_encode($json).')');                        
         $this->_response->appendBody($json);                        
    }      
    
    public function selectadverAction() {
        $obj = new Application_Model_Adver();
        $id = $this->_getParam('id');
        $selectAdver = $obj->getAdver($id);
        
        $style = $obj->getContextSiteSettings($selectAdver['id_site']);
                
        //echo '<a href="'.$selectAdver['url'].'" target="_blank">'.$selectAdver['text'].'</a>';
        $this->view->style = $style;
        $this->view->selectAdver = $selectAdver;
    }
}

?>
